package com.qs.education.bean.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import lombok.Getter;
import lombok.Setter;

@Entity
@Table(name="education_permission",uniqueConstraints={@UniqueConstraint(columnNames={"name"})})
@Getter
@Setter
public class EducationPermission {
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Long id;
	private String name;
	private String url;
	private Long parentId;
	private String permission;
	@ManyToMany(mappedBy="permissions")
	private Set<EducationRole> roles = new HashSet<>();
}
